#include <glib.h>

typedef struct my_data_tag {
    gint id;
    gchar *name;
}my_data_t;

static void _dataset_foreach(GQuark key_id, gpointer data, gpointer user_data)
{
    g_print("key:%s data: %s \n", g_quark_to_string(key_id), (gchar *)data);
}

static void glib_dataset_test (void)
{
    gpointer location = (gpointer)glib_dataset_test;
    gpointer data1 = "test1";
    gpointer data2 = "test2";
    gpointer ret;
    
    g_dataset_set_data (location, "key_test1", data1);
    g_dataset_set_data (location, "key_test2", data2);

    g_dataset_foreach(location, _dataset_foreach, location);
    g_print("Call destroy function \n");
    g_dataset_destroy(location);
}

gint main (gint argc, gchar** argv)
{
    glib_dataset_test();

    return 0;
}